package com.mttk.api.addon.ai.pool.model;

import java.util.List;
import java.util.stream.Collectors;

import org.bson.Document;

import com.mttk.api.addon.AdapterConfig;
import com.mttk.api.util.StringUtil;

public class AiModelDeepseek extends AiModel {
	public AiModelDeepseek(AdapterConfig config) {
		super(config);
	}

	@Override
	public String getPrefix() {
		return "ds";
	}

	@Override
	public boolean applyProp(Document body, String key,String keyReal) {
		if ("stop".equals(keyReal)) {
			List<AdapterConfig> stops= config.getBeanList("prop_ds_stop");
			if(stops==null||stops.size()==0) {
				return true;
			}
			body.append(keyReal,stops.stream().map(a->a.getString("value")).collect(Collectors.toList()));
		} else if ("response_format".equals(keyReal)) {
			String value = config.getString(key, "text");
			body.append(keyReal, new Document("type", value));
			//
			return true;
		} else {
			return false;
		}
		//
		return true;
	}
}
